package personal.domain.accounting;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table (name="income_expense_category")
@NamedQueries({
	@NamedQuery(name=IncomeExpenseCategory.INC_EXP_CAT_GET_ALL, query="select iecat from IncomeExpenseCategory iecat order by iecat.categoryType desc, iecat.parentCategoryId, lower(iecat.categoryName) asc")
})
public class IncomeExpenseCategory implements Serializable {
	private static final long serialVersionUID = 1L;
	public static final String INC_EXP_CAT_GET_ALL = "IncomeExpenseCategory.getAll";
	private Long categoryId;
	private Long parentCategoryId;
	private String categoryName;
	private Character categoryType;
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="category_id", unique=true, length=11, nullable=false, insertable=true, updatable=false)
	public Long getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}
	@Column (name="parent_category_id", length=11, unique=false, nullable=true, insertable=true, updatable=true)
	public Long getParentCategoryId() {
		return parentCategoryId;
	}
	public void setParentCategoryId(Long parentCategoryId) {
		this.parentCategoryId = parentCategoryId;
	}
	@Column (name="category_name", unique=false, length=100, nullable=false, insertable=true, updatable=true)
	public String getCategoryName() {
		return categoryName;
	}
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	@Column (name="category_type", unique=false, length=1, nullable=false, insertable=true, updatable=true)
	public Character getCategoryType() {
		return categoryType;
	}
	public void setCategoryType(Character categoryType) {
		this.categoryType = categoryType;
	}
}
